echo "开始运行！"
if [ -e /opt/module/jdk ]; then
   rm -rf /opt/module/jdk
   echo "/opt/module/jdk,已删除"
fi
sudo mkdir -p /opt/module/jdk
echo "/opt/module/jdk,创建目录成功！"
jdk_tar=`find /opt/upload/software -name jdk-1.8.*`
if [[ $jdk_tar == *"jdk-1.8."* ]]; then
    echo "jdk_tar = $jdk_tar"
else
    echo "jdk_tar，值为空,退出安装"
    exit 1
fi
tar -xzvf $jdk_tar -C /opt/module/jdk
cd /opt/module/jdk
jdk_install=`find /opt/module/jdk -name jdk-1.8.*`
if [[ $jdk_install == *"jdk-1.8."* ]]; then
    echo "jdk_install = $jdk_install"
else
    echo "jdk_install，值为空,退出安装"
    exit 1
fi
echo "修改文件权限,755方便其他用户有权限执行"
sudo chmod -R 755 /opt/module/jdk
java -version
echo "运行结束！"